package operation_log

import (
	"github.com/xinliangnote/go-gin-api/internal/pkg/core"
	"github.com/xinliangnote/go-gin-api/internal/repository/mongodb/operation_log"
)

func (s *service) List(ctx core.Context, pageIndex uint, pageSize uint) (productList []operation_log.OperationLog, err error) {
	model := operation_log.NewModel()
	list, err := model.List(s.db.GetDb(), pageIndex, pageSize)
	return list, err
}

func (s *service) Count(ctx core.Context) (int64, error) {
	model := operation_log.NewModel()
	count, err := model.Count(s.db.GetDb())
	return count, err
}
